<template>
  <basic-container>
    <avue-crud
        v-bind="bindVal"
        v-on="onEvent"
        v-model:page="page"
        v-if="tableOption"
        v-model="form">
      <!-- 菜单按钮 -->
      <template slot="menuLeft">
        <el-button type="primary" v-if="getBtnPermission('downloadTemplateBtn',null,null,false)"
                   @click="downloadTemplate" size="small">下载导入模板
        </el-button>
        <el-button type="primary" v-if="getBtnPermission('exportExcelBtn',null,null,false)" @click="handlerImportExcel"
                   size="small">导入excel
        </el-button>
        <el-button type="primary" v-if="getBtnPermission('importExcelBtn',null,null,false)" @click="downloadExportExcel"
                   size="small">导出excel
        </el-button>
      </template>


    </avue-crud>
    <!-- 数据导入插件 -->
    <import-excel ref="importExcel"
                  upload-name="数据测试导入"
                  :upload-key="pageOption.name"
                  :option="pageOption"
                  @importSuccess="refreshChange">
    </import-excel>
  </basic-container>
</template>

<script>


import ImportExcel from "@/components/common/ImportExcel.vue";
import {createDynamicMixin} from "@/mixins/startCrud.js";

const configOption = {}
// 配置文件映射加载位置
configOption.name = 'test/actFormTestTable'
// 列表-接口
configOption.list = 'list'
// 数据添加-接口
configOption.add = 'add'
// 数据修改-接口
configOption.update = 'update'
// 数据删除-接口
configOption.delete = 'deleteById'
// 数据批量删除-接口
configOption.deletes = 'deleteByIds'
// 下载导入模板-接口
configOption.downloadTemplate = 'downloadTemplate'
// 导出数据-接口
configOption.exportExcel = 'exportExcel'
// 导入数据-接口
configOption.importExcel = 'importExcel'
export default {
  mixins: [createDynamicMixin(configOption)],
  components: {ImportExcel},
  data() {
    return {};
  },
  created() {

  },
  methods: {}
}

</script>

<style scoped lang="scss">

</style>
